<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Notice;

class NoticeController extends Controller
{
    
	public function getList(Request $request)
    {
    	$type = [];
    	$where = [];
    	if($request->type) {
    		$where['type'] = (int)$request->type;
    	}
    	$list = Notice::where($where)
                        ->orderBy('id','desc')
                        ->paginate(5);
    	return view('painting.notice-list',compact('list','type'));
    }

    public function show($id)
    {
    	$data = Notice::find($id);
    	return view('painting.notice',compact('data'));
    }
}
